<template xmlns="http://www.w3.org/1999/html">
    <sea-data-table ref="tableObject" url="/sys/excel/log/page" :where="{excelId: '0001'}">
      <!--表头-->
      <sea-table-header slot="header">
        <!--标题栏-->
        <sea-table-title slot="title" title="Excel导入日志" subtitle="导入的Excel可能是异步执行，提交之后，在这里展示每一行数据的处理结果"></sea-table-title>

        <!--输入-->
        <template slot="input">
          <smart-form-layout require name="keyword" label="关键字" :span="6">
            <smart-text-view name="keyword" placeholder="keyword"></smart-text-view>
          </smart-form-layout>
        </template>

        <!--按钮栏-->
        <template slot="buttons">
          <el-button plain size="small" title="导出Excel" icon="fa fa-download" @click="onAction('export')"></el-button>
        </template>
      </sea-table-header>

      <!--表头-->
      <template slot="columns">
        <sea-col-link type="def" property="batchId" label="执行批次" width="120" :click="onAction"></sea-col-link>
        <el-table-column property="rowNo" label="行号" width="120"></el-table-column>
        <el-table-column property="status" label="状态" width="120"></el-table-column>
        <el-table-column property="msg" label="处理结果"></el-table-column>
        <el-table-column property="gmtCreate" label="创建日期" width="180"></el-table-column>
        <el-table-column property="gmtModified" label="修改日期" width="180"></el-table-column>
      </template>
    </sea-data-table>
</template>

<script>

export default {
    components: {}
    , name: 'LogList'
    , methods: {
        /**
         * 操作成功回调
         */
        onSucceed: function () {
            this.$refs.tableObject.reload();
        },
        /**
         * 操作栏事件分发
         * @param evt 事件
         * @param row 行级对象
         * @param old 可供回滚的参数
         */
        onAction: function (evt, row, old) {
            this.operation = evt;
            if (evt === 'history') {
                let dialog = {title: row.excelName, fullscreen: true};
                this.$refs.dialog.open(dialog).then(() => {
                    this.row_data = row;
                });
            } else if(evt === 'export'){

            } else if(evt === '$batchId'){

            }
        }
    }
}
</script>
